home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / xvi.lha / Xvi_V1.0_Src / amiga.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-04  |  6.8 KB  |  192 lines

  1. /* Copyright (c) 1990,1991,1992 Chris and John Downey; */
  2. /* Copyright (c) 1994 Dan Schmelzer                    */
  3.  
  4. /* Filename amiga.h       */
  5. /* Initial Date:  9/24/94 */
  6. /* Revised Date: 10/18/94 */
  7. /* Author: Dan Schmelzer  */
  8.  
  9. /*
  10.  * @(#)amiga.h
  11.  * Amiga specific type definitions are here.
  12.  */
  13.  
  14. #include <dos.h>
  15. #include <workbench/startup.h>
  16. #include <workbench/workbench.h>
  17. #include <graphics/text.h>
  18. #include <intuition/intuition.h>
  19. #include <intuition/intuitionbase.h>
  20. #include <pragmas/icon_pragmas.h>
  21. #include <pragmas/graphics_pragmas.h>
  22. #include <pragmas/intuition_pragmas.h>
  23. #include <pragmas/exec_pragmas.h>
  24. #include <pragmas/dos_pragmas.h>
  25. #include <pragmas/diskfont_pragmas.h>
  26.  
  27. #ifdef OLD_AMIGA_OS /*________________________________________________*/
  28. #define LIB_REV  34  /* This is 1.3 libs definition. */
  29. #else /*______________________________________________________________*/
  30. #define LIB_REV  36  /* This is 2.0 libs definition (37 for 2.04). */
  31. #endif /*_____________________________________________________________*/
  32.  
  33. #define MIN_ROWS 2   /* Minimum allowed rows for an xvi Amiga window. */
  34. #define MIN_COLS 8   /* Min allowed columns for an xvi Amiga window.  */
  35. #define MAX_ROWS 400 /* Maximum allowed rows for an xvi Amiga window. */
  36. #define MAX_COLS 800 /* Max allowed columns for an xvi Amiga window.  */
  37. #define OUT_BUFFER_SIZE  5000  /* Size of output display buffer. */
  38. #define HELPFILE  "help.xvi"   /* Default help file. */
  39. #define MAX_NAME_LENGTH 40  /* Max number of chars for name in title. */
  40. #define MAX_LEFT_EDGE 1000  /* Max pixels screen-left to window-left. */
  41. #define MAX_TOP_EDGE 800    /* Max pixels screen-top to window-top. */
  42.  
  43. /* If started from workbench these are some of the initial window   */
  44. /* parameters.  They must be within the expected min and max window */
  45. /* dimensions that are chosen when the actual window size is        */
  46. /* determined.  This will depend on MIN_ROWS, MIN_COLS, MAX_ROWS,   */
  47. /* MAX_COL, and on the font size used.  A bit tricky...             */
  48.  
  49. #ifdef OLD_AMIGA_OS /*________________________________________________*/
  50. /* Pre-2.0 Amiga OS.  We have to be careful not to make the initial */
  51. /* window too large or the old OS will have problems.  We know the  */
  52. /* font size is more limited and worst case is probably smaller.    */
  53. #define DFLT_LEFT_EDGE 0
  54. #define DFLT_TOP_EDGE 0
  55. #define INIT_WIDTH 160
  56. #define INIT_HEIGHT 100
  57. /* For OS ver 1.3 worst case is if running lo-res, "60" text width. */
  58. #define DEFAULT_ROWS 20  /* Number of rows if started from Workbench. */
  59. #define DEFAULT_COLS 60  /* Number of cols if started from Workbench. */
  60.  
  61. #else /*______________________________________________________________*/
  62. /* 2.0 or later Amiga OS.  This should work for all */
  63. /* but the very largest or very smallest fonts.     */
  64. #define DFLT_LEFT_EDGE 0
  65. #define DFLT_TOP_EDGE 8     /* Just a little down from top. */
  66. #define INIT_WIDTH 320
  67. #define INIT_HEIGHT 200
  68. #define DEFAULT_ROWS 25  /* Number of rows if started from Workbench. */
  69. #define DEFAULT_COLS 80  /* Number of cols if started from Workbench. */
  70. #endif /*_____________________________________________________________*/
  71.  
  72. /* Default shell command when shell started from xvi without */
  73. /*  SHELL defined.                                           */
  74. #define DFLT_SHELL "newshell WINDOW=CON:18/68/640/390/xvi_Shell/ALT5/250/145/27/CLOSE";
  75.  
  76. extern int Rows;         /* Size of screen (Amiga text window). */
  77. extern int Columns;
  78.  
  79. /*
  80.  * System-dependent constants.
  81.  */
  82. #define MAXPATHLEN 160  /* Maximum length of full path name. */
  83. #define MAXNAMLEN   30  /* Maximum length of filename. */
  84. #define DIRSEPS    "/"  /* Pathname separator for system calls. */
  85.  
  86. /*
  87.  * Default file format characters for \r, \n, and EOF.
  88.  * Amiga uses UNIX.
  89.  */
  90. #define DEF_TFF fmt_UNIX
  91.  
  92. /*
  93.  * Need to pass pointers to argc and argv to Amiga init code.
  94.  */
  95. #define sys_init() amiga_sys_init(&argc,&argv)
  96.  
  97. /*
  98.  * Terminal driving functions.
  99.  */
  100. #define erase_line()   outstr("\233K")     /* Erase to end of line */
  101. #define insert_line()  outstr("\233L")     /* Insert one line */
  102. #define delete_line()  outstr("\233M")     /* Delete one line */
  103. #define invis_cursor() outstr("\2330 p")   /* Invisible cursor */
  104. #define vis_cursor()   outstr("\233 p")    /* Visible cursor */
  105.  
  106. /*
  107.  * Scrolling not currently used.
  108.  */
  109. #define can_scroll_area FALSE
  110. #define scroll_up(x,y,z)
  111. #define scroll_down(x,y,z)
  112.  
  113. /* Cost of using a tty_goto() call. Doesn't seem to be used for much.*/
  114. #define cost_goto   10
  115.  
  116. /*
  117.  * Inserting and deleting lines are also used for scrolling.
  118.  * For Amiga we restrict these to just one line because of performance.
  119.  */
  120. #define can_ins_line TRUE
  121. #define can_del_line TRUE
  122. /* tty_linefeed() isn't needed if can_del_line is TRUE. */
  123. #define tty_linefeed()
  124.  
  125. /*
  126.  * Insert character not used.
  127.  */
  128. #define can_inschar  FALSE
  129. #define inschar(c)
  130.  
  131. /*
  132.  * Color handling.
  133.  * Note that you MUST have leading zero for octal to work!!!
  134.  *
  135.  * Octal number format: 0<sytle><background><foreground>
  136.  *   <sytle> = 0  Plain Text
  137.  *           = 1  Bold-face
  138.  *           = 2  TURN OFF COLOR HANDLING    
  139.  *           = 3  Italic
  140.  *           = 4  Underscore
  141.  *           = 5    (Turn off color handling)
  142.  *           = 6    (Turn off color handling)
  143.  *           = 7  Inverse-video
  144.  *
  145.  *   <background> | <foreground>
  146.  *           = 0  Grey      (OS 2.0 default)
  147.  *           = 1  Black     (OS 2.0 default)
  148.  *           = 2  White     (OS 2.0 default)
  149.  *           = 3  Dark Blue (OS 2.0 default)
  150.  *           = 4  User definable from Workbench
  151.  *           = 5  User definable from Workbench
  152.  *           = 6  User definable from Workbench
  153.  *           = 7  User definable from Workbench
  154.  */
  155. #define DEF_COLOUR     0001 /* Color for "colour" / "co" parameter.   */
  156. #define DEF_ROSCOLOUR  0012 /* Color for "roscolour" / "rst" param.   */
  157. #define DEF_STCOLOUR   0032 /* Color for "statuscolour" / "st" param. */
  158. #define DEF_SYSCOLOUR  0001 /* Color for "systemcolour" / "sy" param. */
  159.  
  160. /*
  161.  * Macros to open files in binary mode,
  162.  * and to expand filenames.
  163.  */
  164. #define fopenrb(f)  fopen((f), "rb")
  165. #define fopenwb(f)  fopen((f), "wb")
  166. #define fexpand(f)  (f)
  167.  
  168. /*
  169.  * Declarations for system interface routines in amiga.c.
  170.  */
  171. extern int    inchar(long);
  172. extern void   outchar(char);
  173. extern void   outstr(char *);
  174. extern void   flush_output();
  175. extern void   erase_display();
  176. extern void   alert(void);
  177. extern void   sleep(unsigned);
  178. extern void   delay(void);
  179. extern void   amiga_sys_init(int, char **);
  180. extern void   sys_exit(int);
  181. extern void   tty_goto(int, int);
  182. extern int    call_system(char *);
  183. extern int    call_shell(char *);
  184. extern void   sys_startv(void);
  185. extern void   sys_endv(void);
  186. extern bool_t can_write(char *);
  187. extern bool_t sys_pipe(char *, int (*)(), long (*)());
  188. extern void   set_colour(int);
  189. extern char   *tempfname(char *);
  190.  
  191. /* End of file________________________________________________________*/
  192.